﻿@model handvn.Models.Product
@{
    ViewBag.Title = "Handvn-Quản lý sản phẩm";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm("UserCreate", "Product", FormMethod.Post, new { enctype = "multipart/form-data", id = "parentForm" }))
{
    if (Request.IsAuthenticated)
    {
    <div class="tl_content_qly_prod">
        <h2>
        QUẢN LÝ SẢN PHẨM</h2>
        @ViewData["key"]
        @Html.ValidationSummary(true)
        <fieldset>
            <legend>THÊM MỚI SẢN PHẨM</legend>
            <div class="editor-label">
                @Html.LabelFor(model => model.DetailCategoriesID, "Chi tiết danh mục")
            </div>
            <div class="editor-field">
                @Html.DropDownList("DetailCategoriesID", String.Empty)
                @Html.ValidationMessageFor(model => model.DetailCategoriesID)
            </div>
            <div class="editor-label">
                Tên sản phẩm
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.TenSanPham)
                @Html.ValidationMessageFor(model => model.TenSanPham)
            </div>
            <div class="editor-label">
                Giá sản phẩm
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.GiaSanPham)
                @Html.ValidationMessageFor(model => model.GiaSanPham)
            </div>
            @*<div class="editor-label">
            @Html.LabelFor(model => model.GiaThiTruong)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.GiaThiTruong)
            @Html.ValidationMessageFor(model => model.GiaThiTruong)
        </div>*@
            <div class="editor-label">
                Số lượng
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.SoLuong)
                @Html.ValidationMessageFor(model => model.SoLuong)
            </div>
            @*<div class="editor-label">
            @Html.LabelFor(model => model.NgayNhapSanPham)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.NgayNhapSanPham)
            @Html.ValidationMessageFor(model => model.NgayNhapSanPham)
        </div>*@
            <div class="editor-label">
                Hình ảnh
            </div>
            <div class="editor-field">
                <input type="file" name="file" id="file" />
                @Html.ValidationMessageFor(model => model.HinhAnh)
            </div>
            <div class="editor-label">
                Giới thiệu
            </div>
            @Html.TextAreaFor(model => model.GioiThieu, new { @class = "adminRichText" })
            <div class="editor-field">
                @* @Html.EditorFor(model => model.GioiThieu)*@
                @Html.ValidationMessageFor(model => model.GioiThieu)
            </div>
            <script language="javascript" type="text/javascript">
                jQuery(".adminRichText").ckeditor();
            </script>
            @* @Html.HiddenFor(model => model.UserID)
            <div class="editor-label">
            @Html.LabelFor(model => model.UserID, "User")
        </div>
        <div class="editor-field">
            @Html.DropDownList("UserID", String.Empty)
            @Html.ValidationMessageFor(model => model.UserID)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.TinhTrang)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.TinhTrang)
            @Html.ValidationMessageFor(model => model.TinhTrang)
        </div>
        *@
            <p>
                <input class="tl_btn" type="submit" value="Thêm mới" />
            </p>
        </fieldset>
        <div>
            @Html.ActionLink("Back to List", "UserView", new { UserID = @Session["UserId"] })
        </div>
    </div>
    }
    else
    {
     <div class="tl_content"style="text-align:center">  
        <p>
            XIN VUI LÒNG ĐĂNG NHẬP</p>
        @Html.ActionLink("Đăng nhập", "Login", "Account")
    </div> 
    }
}
